<h1><%=h "Send Notification To Users".t -%></h1>

<%- form_tag send_notification_admin_users_path, :method => :post do -%>

  <dl>
    <dt><%= label_tag "subject", "Subject".t -%></dt>
    <dd><%= text_field_tag "subject" -%></dd>
  
    <dt><%= label_tag "content", "Message".t -%></dt>
    <dd><%= text_area_tag "content" -%></dd>

    <dt><%= 'Select Users To Notify'.t -%></dt>
    <dd>
      <table id="admin_users_table">
      <caption><%=h "Select users to notify".t -%></caption>
      <tr>
      	<th scope="col"><%=h "Username".t -%></th>
      	<th scope="col"><%=h "Select".t -%></th>
      </tr>

      <tr>
        <td colspan="2">
          <input type="checkbox" onclick="selectAllCheckboxes('user_ids', <%= @users.size -%>, this.checked);">
          <%= label_tag "select_all", "Select All/None".t -%>
        </td>
      </tr>
      
    	<%- @users.each do |user| -%>
      	<tr id="user_<%= user.id %>">
          <td><%= label_tag "user_ids_#{user.id}", user.login -%></td>
          <td><%= check_box_tag "user_ids[]", user.id, false, :id => "user_ids_#{user.id}", :class => "user_id" -%></td>
        </tr> 
      <%- end -%>
      </table>
    </dd>
  </dl>

  <p class="submit"><%= submit_tag "Send Notification".t -%></p>
<%- end -%>

